﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace autoBidProject
{
    public partial class Options : Form
    {
        public Options()
        {
            InitializeComponent();
        }

        private void Options_Load(object sender, EventArgs e)
        {
            ShowSetting();
        }

        private void ShowSetting()
        {
            txtIbetUrl.Text = Setting.Url_Ibet;
            txtSboUrl.Text = Setting.Url_Sbo;

            nudFreshSBO.Minimum = nudFreshIbet.Minimum = 2000;
            nudFreshSBO.Maximum = nudFreshIbet.Maximum = 40000;
            nudFreshIbet.Value = Setting.TimeRefreshIBET;
            nudFreshSBO.Value = Setting.TimeRefreshSBO;
            nudFreshIbet.Increment = 50;

            if (Setting.bEventType == true)
                rbLive.Select();
            else
                rbNonLive.Select();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Setting.Url_Ibet = txtIbetUrl.Text;
            Setting.Url_Sbo = txtSboUrl.Text;

            nudFreshSBO.Minimum = nudFreshIbet.Minimum = 2000;
            nudFreshSBO.Maximum = nudFreshIbet.Maximum = 40000;
            nudFreshIbet.Value = Setting.TimeRefreshIBET;
            nudFreshSBO.Value = Setting.TimeRefreshSBO;
            nudFreshIbet.Increment = 50;

            if (Setting.bEventType == true)
                rbLive.Select();
            else
                rbNonLive.Select();
        }
    }
}
